- merge_access_levels = protected_branch.merge_access_levels.for_role
- push_access_levels = protected_branch.push_access_levels.for_role

%td.merge_access_levels-container
  = hidden_field_tag "allowed_to_merge_#{protected_branch.id}", merge_access_levels.first&.access_level
  = dropdown_tag((merge_access_levels.first&.humanize || 'Select') ,
                 options: { toggle_class: 'js-allowed-to-merge', dropdown_class: 'dropdown-menu-selectable js-allowed-to-merge-container capitalize-header',
                 data: { field_name: "allowed_to_merge_#{protected_branch.id}", preselected_items: access_levels_data(merge_access_levels) }})
  = render_if_exists 'protected_branches/shared/user_merge_access_levels', protected_branch: protected_branch
  = render_if_exists 'protected_branches/shared/group_merge_access_levels', protected_branch: protected_branch

%td.push_access_levels-container
  = hidden_field_tag "allowed_to_push_#{protected_branch.id}", push_access_levels.first&.access_level
  = dropdown_tag((push_access_levels.first&.humanize || 'Select') ,
    options: { toggle_class: "js-allowed-to-push js-multiselect", dropdown_class: 'dropdown-menu-selectable js-allowed-to-push-container capitalize-header',
                 data: { field_name: "allowed_to_push_#{protected_branch.id}", preselected_items: access_levels_data(push_access_levels) }})
  = render_if_exists 'protected_branches/shared/user_push_access_levels', protected_branch: protected_branch
  = render_if_exists 'protected_branches/shared/group_push_access_levels', protected_branch: protected_branch

%td
  = render Pajamas::ToggleComponent.new(classes: 'js-force-push-toggle',
    label: s_("ProtectedBranch|Toggle allowed to force push"),
    is_checked: protected_branch.allow_force_push,
    label_position: :hidden)
